<template>
    <div>
        <van-nav-bar title="搜索" left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />


        <van-cell-group v-for="item in ss">
            
            <van-cell :title="item.goods_name" />
            
        </van-cell-group>
    </div>
</template>

<script setup>

import { useRouter } from 'vue-router';

let routerApi = useRouter([]);

let onClickLeft = () => {
    routerApi.push('/')
}

import { qsearchApi } from '@/api/api';
import { ref, watch } from 'vue';
let ss = ref([]);
let value = ref('');
watch(value, (val) => {
    qsearchApi(val).then(res => {
        console.log(res);
        ss.value = res.data.message
    })
})

</script>

<style lang="scss" scoped></style>